import React from 'react'
import { Navigate } from 'react-router-dom';
import { useState } from 'react';
import { useParams, useLocation } from 'react-router-dom';
type Props = {}

export default function Detail1({ }: Props) {
    const [num, setNum] = useState(0)
    const par = useParams();
    const loc = useLocation()
    console.log('par', par)
    console.log('loc', loc)
    return (
        <div>
            我是详情页
            <p onClick={() => {
                setNum(num + 1)
            }}>{num}</p>
            {
                num == 5 ? <Navigate to='/home1'></Navigate> : <></>
            }
        </div>

    )
}